import React, { Component, ComponentClass } from 'react';
import Taro from '@tarojs/taro';
import {connect} from 'react-redux'
import Skeleton from 'taro-skeleton'
import {AtIcon, AtProgress} from 'taro-ui'
import {View, Image, Navigator, Block, Text, Button} from '@tarojs/components'
import {
  UserIdentity,
  LocalUser,
  SubscriptionType
} from '../../../utils/server.interface';
import {http} from '../../../utils/http'
import {
  GET_NEWS_NUM,
  GETGRADELEVEL,
  RESOURCE_URL,
  TARO_ENV,
  MD_CAN_USE_MD,
  MY_REPORT_DATA,
  CONTENT_PLAT_QR,
  GET_REDBAG_SET, CONTACT, GET_BD_CODE,
  MD_SUPPLIERS,
  FETCH_WIFI_VISIBLE
} from '../../../constants/api'
import fetchNewGoodsList from "../../../utils/fetchNewGoodsList";
import {user} from '../../../utils/user.service';
import FloatRedbag from '../../../components/float-redbag/float-redbag'
import {getRedBagSet} from '../../../actions/redbag';
import {platform} from '../../../utils/platform-settting.service';
import {getHeadTop, gotoPage as gotoApage, vcmonitor, clearSearch} from '../../../utils/tools'
import {getPoster} from "../../../utils/poster.service";
import Subscription from "../../../components/subscription";
import GzhAuth from "../../../components/gzh-auth/gzh-auth";
import SupportBar from "../../../components/support-bar/support-bar";
import {newHttp} from "../../../utils/request";
import {getGlobalData} from "../../../utils/global"
import LiveCode from "../../../components/liveCode/liveCode"
import {getVIPUser} from "../../../utils/getCommonData";
import '../../../components/liveCode/liveCode.scss'
import SmallGoodsBox from "../../../components/small-goods-box/small-goods-box";
import CustomTabBar from "../../../components/tabBar/tab-bar";
import './index.scss'

const NOT_LX_H5 = process.env.P_ENV === 'lx' && TARO_ENV !== "h5";

type PageStateProps = {
  user: LocalUser
}

type PageDispatchProps = {
  onSetRedBag
}

type PageOwnProps = {}

type PageState = {
  modalShowBusiness: boolean
  tabBarInfo: any
  businessCooperationImg: string
  businessCooperationImgDescribe: string
  userInfo?: any
  contactPhone?: any
  tipsNum: number
  isMd: boolean
  hasSupplier: boolean
  showLoading: boolean
  platformSet: any
  userIdentity: UserIdentity | false
  isLogin: boolean
  searchBarTop: number
  gradelevel: any
  newsNum: {
    isSellerNews: number
    newsTypeId: number
    sellerNewsNoReadNum: number
    isNewcomerNews: number
    newcomerTypeId: number
  } | false
  openMp: SubscriptionType | false
  active: number | string
  dateData: any
  goodsList: any
  modalShow: boolean
  reportData: {
    estimatedEarnings: number
    orderNum: number
    newTalent: number
  }
  qrImg: any
  qrImgDescribe: any
  certificationUrl: any
  clickNum: any
  lastTapTime: any
  isHongBao: number
  wifiVisible: boolean
}

type IProps = PageStateProps & PageDispatchProps & PageOwnProps

interface Index {
  props: IProps
}

@connect(({}) => ({}), (dispatch) => ({
  onSetRedBag() {
    dispatch(getRedBagSet())
  }
}))

class Index extends Component {

  state: PageState = {
    clickNum: 1,
    lastTapTime: 0,
    tabBarInfo: false,
    modalShowBusiness: false,
    userInfo: false,
    businessCooperationImg: '',
    businessCooperationImgDescribe: '',
    tipsNum: 0,
    contactPhone: '',
    isMd: false,
    hasSupplier: false,
    showLoading: true,
    userIdentity: false,
    isLogin: false,
    newsNum: false,
    gradelevel: false,
    searchBarTop: 0,
    platformSet: {},
    openMp: false,
    active: 0,
    dateData: ['今日', '昨日', '本月', '全部'],
    goodsList: [],
    modalShow: false,
    reportData: {
      estimatedEarnings: 0.00,
      orderNum: 0,
      newTalent: 0
    },
    qrImg: '',
    certificationUrl: '',
    qrImgDescribe: '',
    isHongBao: 0,
    wifiVisible: false
  }

  async UNSAFE_componentWillMount() {
    const headTop: any = getHeadTop()
    let searchBarTop = headTop.statusBar > 20 ? (headTop.statusBar + headTop.top + 30) : (headTop.statusBar + headTop.top + 40)
    if (TARO_ENV === 'h5' || TARO_ENV === 'tt') {
      searchBarTop -= 30
    }
    let qrImg
    let qrImgDescribe
    if (TARO_ENV !== 'tt') {
      const res = await http.HGet(CONTENT_PLAT_QR);
      if (res && res.data) {
        qrImg = res.data.code || ''
        qrImgDescribe = res.data.code_describe || ''
      }
    }
    this.setState({searchBarTop, qrImg, qrImgDescribe})
  }

  async componentDidShow() {
    vcmonitor(this)
    clearSearch()
    const pageObj = this.instance.page
    let tabbar
    if (process.env.TARO_ENV === 'weapp') {
      tabbar = Taro.getTabBar(pageObj)
    }
    platform.getIndexNavigation().then(res => {
      if (res) {
        const tabBarInfo = JSON.parse(res)
        const pagePath = pageObj.route
        if (process.env.TARO_ENV === 'weapp') {
          tabbar.setState({ tabBarInfo, pagePath, isBigIndexPage: false })
        } else {
          this.setState({ tabBarInfo })
        }
      }
    })
    if (platform.subscription.show_place) {
      if (platform.subscription.show_place.indexOf("3") > -1) {
        this.setState({
          openMp: platform.subscription
        })
      }
    }
    await this.getUser()
    const result = await fetchNewGoodsList.getGoodsList({
      module_type: "1",
      page: 1,
      length: 12,
    });
    let likeList: any = result ? {data: result} : false;
    if (!likeList) {
      likeList = []
    }
    this.setState({goodsList: likeList.data});
    if (TARO_ENV === 'tt') {
      return false
    }
    let reportData = await newHttp.get(MY_REPORT_DATA + "?type=今日", {})
    if (!reportData) {
      reportData = {estimatedEarnings: 0.00, orderNum: 0, newTalent: 0}
    }
    this.setState({reportData: reportData.data});
    const res = await http.get(CONTACT, {})
    if (res && res.contact_0 && res.contact_0.phone) {
      this.setState({contactPhone: res.contact_0.phone})
    }
    const resImg = await http.HGet(CONTENT_PLAT_QR);
    this.setState({qrImg: resImg ? resImg.data.code : '', qrImgDescribe: resImg ? resImg.data.code_describe : ''})
  }

  instance: any = Taro.getCurrentInstance()

  async checkMd() {
    return await newHttp.catchPost(MD_CAN_USE_MD)
  }

  async getSupplier() {
    const suppliers = await newHttp.catchPost(MD_SUPPLIERS);
    return Array.isArray(suppliers)
  }

  getWiFiStatus = async (userId) => {
    return await newHttp.catchGet(FETCH_WIFI_VISIBLE, {userId});
  }

  async getUser() {
    const isLogin = await user.checkLogin()
    if (isLogin) {
      if (process.env.IS_SHOW_RED_BAG) {
        const redbag = await http.HGet(GET_REDBAG_SET);
        if (redbag && redbag.data && redbag.data.moduleSet) {
          this.setState({isHongBao: redbag.data.moduleSet.isHongbao})
        }
      }
      const userIdentity: any = await user.getUserData()
      if (!userIdentity) {
        return
      }
      if (!userIdentity.headimg) {
        userIdentity.headimg = RESOURCE_URL + "/resources/weapp/images/headimg.png"
      }
      const userInfo = await getVIPUser()
      this.setState({isLogin, userIdentity, userInfo})
      if (TARO_ENV !== 'tt') {
        let gradelevel
        if (userIdentity && userIdentity.isSeller) {
          gradelevel = await http.get(GETGRADELEVEL)
        }
        gradelevel && this.getThisLevel(gradelevel)
        const isMd = await this.checkMd()
        const hasSupplier = await this.getSupplier()
        const newsNum = await http.get(GET_NEWS_NUM, {})
        const wifiVisible = await this.getWiFiStatus(userIdentity.userId);
        this.setState({newsNum, isMd, hasSupplier, wifiVisible})
      }
    }
    this.props.onSetRedBag()
    if (!process.env.IS_SHOW_MEMBER) {
      platform.info.applicationOpenVip = 0
    }
    const certificationUrl: any = []
    if (process.env.TARO_ENV === 'tt') {
      try {
        if (platform.info.certificationUrl) {
          const urlList = JSON.parse(platform.info.certificationUrl)
          urlList.map(item => certificationUrl.push(item.url))
        }
      } catch (e) {
        console.log(e)
      }
    }
    this.setState({
      showLoading: false, platformSet: platform.info, certificationUrl
    })
  }

  async onPullDownRefresh() {
    await user.setUserData()
    await this.getUser()
    Taro.stopPullDownRefresh()
  }

  async getThisLevel(gradelevel) {
    if (gradelevel.sellerGroupId > 0) {
      gradelevel.gradeLevelInfo.map((item, index) => {
        if (gradelevel.sellerGroupId == item.id) {
          gradelevel['thisindex'] = index
          gradelevel['percentage'] = gradelevel.gradeLevelInfo[index + 1] ? ((gradelevel.sonSellerNum / (gradelevel.gradeLevelInfo[index + 1].rule_num - item.rule_num)) * 100) : ((gradelevel.sonSellerNum / (item.rule_num)) * 100)
        }
      })
    } else {
      gradelevel.gradeLevelInfo.unshift({id: 0, name: process.env.P_ENV === 'kd' ? '普通分销' : '小白', rule_num: 0})
      gradelevel['thisindex'] = 0
      gradelevel['percentage'] = gradelevel.gradeLevelInfo[1] ? ((gradelevel.sonSellerNum / gradelevel.gradeLevelInfo[1].rule_num) * 100) : 0
    }
    this.setState({gradelevel})
  }

  async showUserId(e) {
    if (this.state.isLogin) {
      const curTime = e.timeStamp
      const lastTime = this.state.lastTapTime
      if (curTime - lastTime <= 350) {
        await this.setStateSync({clickNum: this.state.clickNum + 1})
      } else {
        await this.setStateSync({clickNum: 1})
      }
      if (this.state.clickNum % 10 === 0) {
        const userId = this.state.userIdentity.userId
        await Taro.setClipboardData({
          data: userId,
          success: () => {
            Taro.showToast({title: "内容已复制，您的userId为: " + userId + '', icon: 'none'})
          }
        })
      }
      await this.setStateSync({
        lastTapTime: curTime
      })
    }
  }

  setStateSync(state) {
    return new Promise(resolve => {
      this.setState(state, resolve)
    })
  }

  async gotoPage(url, status?) {
    // status: 用来我的订单的订单状值的判断，进入时的状态希望返回时能回到当前点击的状态
    const isLogin = await user.checkLogin()
    if (isLogin) {
      if (status || status === 0) {
        Taro.setStorageSync("order-status", status)
      }
      Taro.navigateTo({
        url
      })
    } else {
      user.jumpLogin()
    }
  }

  async getPoster() {
    Taro.showLoading({title: '加载中...'})
    const poster = await getPoster('vip', '')
    if (poster) {
      if (TARO_ENV === "weapp") {
        try {
          const ret = await Taro.getImageInfo({src: poster.url})
          if (ret) {
            this.gotoPage('/distributor/poster/poster?url=' + ret.path)
          }
        } catch (e) {
          Taro.showToast({title: '获取海报失败', icon: 'none'})
        }
      } else {
        this.gotoPage('/distributor/poster/poster?url=' + poster.url)
      }
    }
    setTimeout(() => {
      Taro.hideLoading()
    }, 100)
  }

  witchGoto(item) {
    if (item.indexOf("?") != -1) {
      item += '&self=1'
    } else {
      item += '?self=1'
    }
    gotoApage(item)
  }

  toThousands(num) {
    let result = [], counter = 0;
    num = num.toFixed(2)
    const newnum = num.toString().split('.')
    const numary = newnum[0].split('');
    for (let i = numary.length - 1; i >= 0; i--) {
      counter++;
      result.unshift(numary[i]);
      if (!(counter % 3) && i != 0) {
        result.unshift(',');
      }
    }
    return result.join('') + '.' + newnum[1];
  }

  onShareAppMessage() {
    return {
      title: "我的",
      path: '/pages/my/index/index' + `?sKey=${Taro.getStorageSync('sKey' || '')}`
    }
  }

  jump(url) {
    Taro.navigateTo({
      url
    })
  }

  async changeData(item, active) {
    const res = await http.HGet(MY_REPORT_DATA, {type: item})
    if (res) {
      const reportData = res.data
      this.setState({
        reportData
      });
    }
    this.setState({
      active
    });
  }

  handleClose() {
    this.setState({modalShow: false})
  }

  showTips(num) {
    this.setState({tipsNum: num}, () => {
      const timer = setTimeout(() => {
        this.setState({
          tipsNum: 0
        })
        clearTimeout(timer)
      }, 3000)
    })
  }

  contactSite() {
    const {qrImg} = this.state
    if (!qrImg || qrImg === 'variable_code_close') {
      return this.gotoPage('/distributor/contact/contact')
    } else {
      this.setState({modalShow: true})
    }
  }

  async businessCooperation() {
    let res
    if (process.env.IS_SHOW_LIVING_CODE) {
      res = await http.HGet(GET_BD_CODE);
    }
    const {userIdentity} = this.state
    if (!res || !res.data || res.data.length <= 0 || res.data === 'variable_code_close') {
      return this.gotoPage(`/main/site/partner?sid=${userIdentity.joinId}`)
    } else {
      const businessCooperationImgDescribe = res.data[0].code_describe || "联系商家";
      this.setState({modalShowBusiness: true, businessCooperationImg: res.data[0].code, businessCooperationImgDescribe})
    }
  }

  render() {
    const dataColor = Taro.getStorageSync('colorData');
    const {
      showLoading,
      userInfo,
      platformSet,
      dateData,
      reportData,
      active,
      contactPhone,
      isMd,
      hasSupplier,
      searchBarTop,
      isLogin,
      newsNum,
      gradelevel,
      tipsNum,
      openMp,
      modalShow,
      qrImg,
      qrImgDescribe,
      goodsList,
      isHongBao,
      modalShowBusiness,
      businessCooperationImg,
      businessCooperationImgDescribe,
      certificationUrl,
      tabBarInfo,
      wifiVisible
    } = this.state
    const userIdentity: any = this.state.userIdentity;
    return (
      <View className={`root myRoot ${TARO_ENV + 'myRoot'}`}>
        <GzhAuth />
        {TARO_ENV !== 'weapp' && <View style='position: fixed; width: 100%; z-index: 9999; bottom: 0px; left: 0;'><CustomTabBar pagePath='pages/my/index/index' isBigIndexPage={false} tabBarInfo={tabBarInfo} /></View>}
        <View className={`${process.env.P_ENV + 'head-bg'} head-bg ${TARO_ENV + 'MyLoading'}`}
          style={`background-image:url(${process.env.myBk});`}
        >
          <View className='headimg-wrap' style={`padding-top: ${searchBarTop || (TARO_ENV === 'h5' ? 20 : 64)}Px;`}>
            <View className='headimg-box' onClick={this.gotoPage.bind(this, '/main/my/setting/setting')}>
              <View className='heading-wrapper'>
                <View className='headimg'>
                  <Skeleton animate={false} loading={showLoading} avatar className='my-skeleton-cla'><Image
                    className='img'
                    src={userIdentity.headimg || RESOURCE_URL + "/resources/weapp/images/headimg.png"}
                    mode='aspectFill'
                  /></Skeleton>
                </View>
              </View>
              {!showLoading && <View className='info-box'>
                {isLogin && <View className='nickname'>{userIdentity.nickname || ''}</View>}
                {!isLogin && <View className='nickname'>游客</View>}
                {isLogin && userIdentity.phone && <Text className='nickname_phone'>{userIdentity.phone}</Text>}
                {isLogin && userIdentity && userIdentity.isSeller && userIdentity.isAutoUpgrade && gradelevel.thisindex != undefined && !gradelevel.gradeLevelInfo[gradelevel.thisindex + 1] &&
                <View className='label'>
                  <Image className='img' src={RESOURCE_URL + "/resources/weapp/images/king.png"}
                    mode='aspectFill'
                  />{gradelevel.gradeLevelInfo[gradelevel.thisindex].name}
                </View>}
              </View>}
              {process.env.P_ENV === 'kd' && <Image className='headImg_kedou'
                src='https://resource.ivcheng.com/upload/file/15ade41b6e564fadb228eea79e594e08.png'
              />}
              {!showLoading && process.env.P_ENV === 'kd' && <Image className='headImg_kedou_shape'
                src='https://resource.ivcheng.com/upload/images/20211026/1635240463852_831.png'
              />}
            </View>
            {!showLoading && <Block>
              {TARO_ENV !== 'tt' && userIdentity && userIdentity.isSeller && userIdentity.isAutoUpgrade && gradelevel.thisindex != undefined && gradelevel.gradeLevelInfo[gradelevel.thisindex + 1] &&
              <View className={`${userIdentity.isSeller ? 'open-vip' : ''} rankbox`}>
                <View className='rank-left'>
                  <View className='rank-name'>{gradelevel.gradeLevelInfo[gradelevel.thisindex].name}</View>
                  <View className='rank-Progress'>
                    <View
                      className='rank-Percent'
                    >{gradelevel.sonSellerNum + '/' + (gradelevel.gradeLevelInfo[gradelevel.thisindex + 1] ? gradelevel.gradeLevelInfo[gradelevel.thisindex + 1].rule_num : gradelevel.gradeLevelInfo[gradelevel.thisindex].rule_num)}</View>
                    <AtProgress percent={gradelevel.percentage} color='#ffda86' strokeWidth={4} isHidePercent />
                  </View>
                  <View
                    className='rank-name'
                  >{gradelevel.gradeLevelInfo[gradelevel.thisindex + 1] ? gradelevel.gradeLevelInfo[gradelevel.thisindex + 1].name : gradelevel.gradeLevelInfo[gradelevel.thisindex].name}</View>
                </View>

                <View className='rank-right' onClick={() => {
                  Taro.navigateTo({
                    url: '/distributor/wallet/rank?upgrade=' + (userIdentity.isCanHaveSon ? userIdentity.isCanHaveSon : '')
                  })
                }
                }
                >{userIdentity.isCanHaveSon ? '立即升级' : '查看'}<Image className='img'
                  src={RESOURCE_URL + "/resources/weapp/images/jiantou.png"}
                  mode='aspectFill'
                /></View>
              </View>
              }
              {isLogin && !!platformSet && !!platformSet.applicationOpenVip && <View
                className={`${userIdentity && userIdentity.isAutoUpgrade && gradelevel.thisindex != undefined && gradelevel.gradeLevelInfo[gradelevel.thisindex + 1] ? 'no-top-radius' : 'top-radius'} member-wrap`}
                onClick={this.gotoPage.bind(this, '/main/my/member/interests')}
              >
                <View className='rankbox-header-content vip'>
                  <Image mode='aspectFill' className='vip-img'
                    src={RESOURCE_URL + "/upload/images/20220906/1662453106989_481.png"}
                  />
                  {userInfo.status === 1 &&
                  <View className='one-vip'><Text className='vip-name'>{userInfo.name || ''}</Text><Text
                    className='welfaress'
                  >有效期：{userInfo.is_forever ? '永久有效' : userInfo.end_date}</Text></View>}
                  {userInfo.status === 2 &&
                  <View className='one-vip'>会员专享<Text className='welfaress no-open'>享折扣，享会员价</Text></View>}
                  {userInfo.status === 0 &&
                  <View className='one-vip'><Text className='welfaress no-open'>{userInfo.end_date_info}</Text></View>}
                </View>
                {userInfo.status === 2 && <View className='leader'>开通享特权</View>}
                {userInfo.status === 0 && <View className='leader'>立即续费</View>}
                {userInfo.status === 1 && <View className='leader member-right'>会员权益</View>}
              </View>}
            </Block>}
          </View>
        </View>
        {
          TARO_ENV !== 'tt' && userIdentity.isSeller && !showLoading && (process.env.P_ENV !== 'lx' || NOT_LX_H5) &&
          <View>
            <View className='my-total-revenue'>
              <View className='my-total-revenue-title'>我的总收益(元)</View>
              <View className='my-total-revenue-lr-layout m-b-35'
                onClick={this.gotoPage.bind(this, '/distributor/wallet/wallet?uuid=' + userIdentity.uuid + '&isSeller=' + userIdentity.isSeller)}
              >
                <View
                  className='my-total-revenue-lr-layout-left my-total-revenue-lr-layout-price'
                >{userIdentity.allBalance || 0}</View>
                <View className='my-total-revenue-lr-layout-right my-total-revenue-lr-layout-btn primary'>
                  去提现
                  <AtIcon value='chevron-right'
                    size='12'
                    color='#fff'
                  />
                </View>
              </View>
              <View
                className={`my-total-revenue-scattered-layout m-b-60 ${!!userIdentity.frozen_balance && 'four-piece'}`}
              >
                <View className='my-total-revenue-scattered-layout-item'>
                  <View className='my-total-revenue-scattered-layout-item-title'>可提现(元)</View>
                  <View
                    className='my-total-revenue-scattered-layout-item-price'
                  >{userIdentity.withdrawBalance || 0}</View>
                </View>
                <View className='my-total-revenue-scattered-layout-item'>
                  <View className='my-total-revenue-scattered-layout-item-title'>已提现(元)</View>
                  <View
                    className='my-total-revenue-scattered-layout-item-price'
                  >{userIdentity.withdrawalMoney || 0}</View>
                </View>
                {process.env.P_ENV === 'kd' &&
                <View className='my-total-revenue-scattered-layout-item'
                  onClick={this.gotoPage.bind(this, '/main/order/userCoinBalanceList')}
                >
                  <View className='my-total-revenue-scattered-layout-item-title'>蝌蚪币(元) <Text
                    onClick={this.showTips.bind(this, 5)} className='aticon'
                  ><AtIcon value='help'
                    customStyle='vertical-align:middle !important;'
                    size='13' color='#bfbfbf'
                  /></Text></View>
                  <View
                    className='my-total-revenue-scattered-layout-item-price'
                  >{userIdentity.coinFee || 0}</View>
                  <View
                    className={`tips tips5 ${tipsNum == 5 ? 'twos' : ''} ${!!userIdentity.frozen_balance && 'five-piece'}`}
                  >订单产生的退款,不支持提现,可用于商城消费</View>
                </View>
                }
                <View className='my-total-revenue-scattered-layout-item'
                  onClick={this.gotoPage.bind(this, '/main/order/promotionOrder?noTime=true&search_money_status=1')}
                >
                  <View className='my-total-revenue-scattered-layout-item-title'>待入账(元)</View>
                  <View
                    className='my-total-revenue-scattered-layout-item-price'
                  >{userIdentity.unWithdrawBalance || 0}</View>
                </View>
                {!!userIdentity.frozen_balance &&
                <View className='my-total-revenue-scattered-layout-item'>
                  <View className='my-total-revenue-scattered-layout-item-title'><Text
                    onClick={this.gotoPage.bind(this, '/distributor/wallet/debts?uuid=' + userIdentity.uuid)}
                  >冻结(元)</Text>
                    <View onClick={this.showTips.bind(this, 3)} className='aticon'><AtIcon value='help'
                      customStyle='vertical-align:middle !important;'
                      size='13'
                      color='#bfbfbf'
                    /></View>
                  </View>
                  <View className={`tips tips3 ${tipsNum == 3 ? 'twos' : ''}`}>收益全部提现后，用户发生退款，商家帮您承担的费用</View>
                  <View className='my-total-revenue-scattered-layout-item-price'
                    onClick={this.gotoPage.bind(this, '/distributor/wallet/debts?uuid=' + userIdentity.uuid)}
                  >{userIdentity.frozen_balance || 0}</View>
                </View>}
              </View>
              {(userIdentity.platformSellerType === 1 || (userIdentity.platformSellerType === 0 && userIdentity.sellerType === 2)) && userIdentity.isCanHaveSon &&
              <View className='my-total-revenue-lr-layout m-b-35'>
                <View className='my-total-revenue-lr-layout-left my-total-revenue-lr-layout-text'>
                  {process.env.fxName}：<Text className='green'>{gradelevel.sonSellerNum}人</Text>
                </View>
                <View className='my-total-revenue-lr-layout-right my-total-revenue-lr-layout-btn'
                  onClick={this.gotoPage.bind(this, `/main/my/distributor/index?sellerId=${userIdentity.sellerId}&sid=${userIdentity.siteId}&sourceUserId=${userIdentity.userId}`)}
                >
                  邀请好友
                </View>
              </View>}
            </View>
            {
              (process.env.P_ENV !== 'lx' || NOT_LX_H5) &&
              (!!userIdentity.commonBalance || userIdentity.commonBalance == 0) &&
                <View className='my-total-revenue'>
                <View className='my-total-revenue-title' style='margin-bottom: 20px;'>授信额度(元)</View>
                <View className='my-total-revenue-scattered-layout'>
                  <View className='my-total-revenue-scattered-layout-item'>
                    <View className='my-total-revenue-scattered-layout-item-title'>当前应还(元)</View>
                    <View
                      className='my-total-revenue-scattered-layout-item-price'
                    >{this.toThousands(userIdentity.repayment) || 0}</View>
                  </View>
                  <View className='my-total-revenue-scattered-layout-item'>
                    <View className='my-total-revenue-scattered-layout-item-title'>可用额度(元)</View>
                    <View
                      className='my-total-revenue-scattered-layout-item-price'
                    >{this.toThousands(userIdentity.commonBalance) || 0}</View>
                  </View>
                </View>
              </View>
            }
            {userIdentity.isSeller && <View className='my-total-revenue'>
              <View className='my-total-revenue-title my-total-revenue-title-flex'
                onClick={this.gotoPage.bind(this, "/distributor/report/index")}
              >
                <View className='my-total-revenue-title-flex_headText'>数据报表</View>
                <Image className='my-total-revenue-title-flex-image'
                  src='https://resource.ivcheng.com/resources/images/arrow-right.png'
                />
              </View>
              <View className='my-total-revenue-scattered-layout m-b-30 radius'>
                {
                  dateData.map((item, index) => {
                    return (
                      <View
                        key={index}
                        className={`my-total-revenue-scattered-layout-btn ${index == active ? 'active' : ''}`}
                        onClick={() => this.changeData(item, index)}
                      >
                        {item}
                      </View>
                    )
                  })
                }
              </View>
              <View className='my-total-revenue-scattered-layout'>
                <View className='my-total-revenue-scattered-layout-item'>
                  <View className='my-total-revenue-scattered-layout-item-title'>预估收益(元)
                    <View onClick={this.showTips.bind(this, 1)} className='aticon'> <AtIcon value='help'
                      customStyle='vertical-align:middle !important;'
                      size='13'
                      color='#bfbfbf'
                    /></View>
                  </View>
                  <View className='my-total-revenue-scattered-layout-item-price'>{reportData.estimatedEarnings}</View>
                  <View className={`tips ${tipsNum == 1 ? 'twos' : ''}`}>预估收益是指待结算金额</View>
                </View>
                <View className='my-total-revenue-scattered-layout-item'>
                  <View className='my-total-revenue-scattered-layout-item-title'>收益订单(笔)<View
                    onClick={this.showTips.bind(this, 2)} className='aticon'
                  > <AtIcon value='help' customStyle='vertical-align:middle !important;' size='13'
                    color='#bfbfbf'
                  /></View></View>
                  <View className='my-total-revenue-scattered-layout-item-price'>{reportData.orderNum}</View>
                  <View className={`tips tips2 ${tipsNum == 2 ? 'twos' : ''}`}>包含该分销商分享的已付款及已完成的订单</View>
                </View>
                <View className='my-total-revenue-scattered-layout-item'>
                  <View className='my-total-revenue-scattered-layout-item-title'>新增{process.env.fxName}</View>
                  <View className='my-total-revenue-scattered-layout-item-price'>{reportData.newTalent}</View>
                </View>
              </View>
            </View>}
          </View>
        }
        {showLoading &&
        <View className={`my-skeleton-account-discount-wrapper ${TARO_ENV + 'my-skeleton-account-discount-wrapper'}`}>
          <Skeleton loading={showLoading} title row={2} type='column' className='my-skeleton-account-discount' />
          <Skeleton loading={showLoading} title row={2} type='column' className='my-skeleton-account-discount' />
          <Skeleton loading={showLoading} title row={2} type='column' className='my-skeleton-account-discount' />
        </View>}
        {!showLoading && <View className='can-use-box'>
          {TARO_ENV !== 'tt' && !userIdentity.isSeller && process.env.P_ENV !== 'lx' && <Block>
            <View className='my-wallet'>
              <View className={`${process.env.P_ENV === 'kd' && 'column-my-wallet'}`}>
                <View className='my-wallet-left'>
                  <Text style='margin-right: 4px;'>金额(元)</Text><Text className='allBalance'
                    decode
                  >{userIdentity.allBalance || 0}</Text>
                </View>
                {process.env.P_ENV === 'kd' && <View className='my-wallet-left'>
                  <Text style='margin-right: 4px;'>蝌蚪币(元) <Text onClick={this.showTips.bind(this, 4)}
                    className='aticon'
                  ><AtIcon value='help'
                    customStyle='vertical-align:middle !important;'
                    size='13'
                    color='#bfbfbf'
                  /></Text></Text>
                  <Text className='allBalance' decode>{userIdentity.coinFee || '0'}</Text>
                  <View className={`tips tips4 ${tipsNum == 4 ? 'twos' : ''}`}>订单产生的退款,不支持提现,可用于商城消费</View>
                </View>}
              </View>
              <View className='my-wallet-right' style={`background:${dataColor.gradientColor}`}
                onClick={this.gotoPage.bind(this, '/distributor/wallet/wallet?uuid=' + userIdentity.uuid + '&isSeller=' + userIdentity.isSeller)}
              >我的钱包<AtIcon
                value='chevron-right' size='12' color='#fff'
              /></View>
            </View>
            <View className='my-wallet-line' />
          </Block>}
          {(process.env.IS_SHOW_RED_BAG || process.env.IS_SHOW_INTEGRAL || process.env.IS_SHOW_COUPON) && <View className='user-ticket'>
            {process.env.IS_SHOW_COUPON && <View className='item' onClick={this.gotoPage.bind(this, '/main/coupon/index')}>
              <View className='m-b-15'>
                <Image src={`${process.env.myyhq}`}
                  mode='aspectFit' className='coupon-img'
                />
              </View>
              <View className='name'>优惠券</View>
              <View className='canuse-num'>
                <View className='lt'>可用</View>
                <View className='rt'>{userIdentity.couponCnt || 0}张</View>
              </View>
            </View>}
            {process.env.IS_SHOW_RED_BAG && <View className='item' onClick={this.gotoPage.bind(this, '/main/my/redbag/list')}>
              <View className='m-b-15'>
                <Image src={`${process.env.myhb}`}
                  mode='aspectFit' className='coupon-img'
                />
              </View>
              <View className='name scend'>红包</View>
              <View className='canuse-num'>
                <View className='lt'>可用</View>
                <View className='rt'>{userIdentity.hongbaoCnt || 0}张</View>
              </View>
            </View>}
            {process.env.IS_SHOW_INTEGRAL && platformSet.isJumpIntegral &&
            <View className='item' onClick={this.gotoPage.bind(this, '/main/my/integral/integral')}>
              <View className='m-b-15'>
                <Image src={`${process.env.myjf}`}
                  mode='aspectFit' className='coupon-img'
                />
              </View>
              <View className='name'>{getGlobalData()}</View>
              <View className='canuse-num'>
                <View className='lt'>累积</View>
                <View className='rt'>{userIdentity.integral || 0}</View>
              </View>
            </View>}
            {process.env.IS_SHOW_INTEGRAL && !platformSet.isJumpIntegral &&
            <View className='item'>
              <View className='m-b-15'>
                <Image src={`${process.env.myjf}`}
                  mode='aspectFit' className='coupon-img'
                />
              </View>
              <View className='name'>{getGlobalData()}</View>
              <View className='canuse-num'>
                <View className='lt'>累积</View>
                <View className='rt'>0</View>
              </View>
            </View>}
          </View>}
        </View>}
        <Skeleton animate={false} loading={showLoading} title className='my-skeleton-float-red-bag' />
        {
          (process.env.P_ENV !== 'lx' || NOT_LX_H5) &&
          isHongBao === 1 && <FloatRedbag />
        }
        {showLoading && <View className='order-top-header'>
          <Skeleton loading={showLoading} title
            className={`my-skeleton-account-discount-order-top-left ${TARO_ENV + 'my-skeleton-account-discount-order-top-h5'}`}
          />
          <Skeleton loading={showLoading} title
            className={`my-skeleton-account-discount-order-top-right ${TARO_ENV + 'my-skeleton-account-discount-order-top-h5'}`}
          />
        </View>}
        {showLoading && <View className='my-skeleton-account-discount-order-header'>
          <Skeleton loading={showLoading} title row={1} type='column'
            className={`my-skeleton-account-discount-order ${TARO_ENV + 'my-skeleton-account-discount-order'}`}
          />
          <Skeleton loading={showLoading} title row={1} type='column'
            className={`my-skeleton-account-discount-order ${TARO_ENV + 'my-skeleton-account-discount-order'}`}
          />
          <Skeleton loading={showLoading} title row={1} type='column'
            className={`my-skeleton-account-discount-order ${TARO_ENV + 'my-skeleton-account-discount-order'}`}
          />
          <Skeleton loading={showLoading} title row={1} type='column'
            className={`my-skeleton-account-discount-order ${TARO_ENV + 'my-skeleton-account-discount-order'}`}
          />
        </View>}
        {!showLoading && <View className='order-box'>
          <View className='card'>
            <View className='card-head'>
              <View className='title' onClick={this.showUserId.bind(this)}>我的订单</View>
              <View className='tips'><View
                onClick={this.gotoPage.bind(this, '/main/order/order?status=-1', -1)}
              >全部订单 <AtIcon className='order' value='chevron-right'
                size='12'
              /></View></View>
            </View>
            <View className='card-content'>
              <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/order/order?status=-1', -1)}>
                <Image src={`${process.env.orderall}`}
                  mode='widthFix' className='order-img'
                />
                <View className='btn-text'>全部</View>
              </View>
              <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/order/order?status=0', 0)}>
                <Image src={`${process.env.orderdfk}`}
                  mode='widthFix' className='order-img'
                />
                <View className='btn-text'>待付款</View>
              </View>
              <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/order/order?status=55', 55)}>
                <Image src={`${process.env.orderdsy}`}
                  mode='widthFix' className='order-img'
                />
                <View className='btn-text'>待使用</View>
              </View>
              <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/order/order?status=66', 66)}>
                <Image src={`${process.env.orderywc}`}
                  mode='widthFix' className='order-img'
                />
                <View className='btn-text'>已完成</View>
              </View>
            </View>
          </View>
        </View>}
        {showLoading && <View className='order-top-header'>
          <Skeleton loading={showLoading} title className='my-skeleton-account-discount-order-top-left' />
        </View>}
        {showLoading && <View className='my-skeleton-account-discount-order-header'>
          <Skeleton loading={showLoading} title row={1} type='column'
            className={`my-skeleton-account-discount-order ${TARO_ENV + 'my-skeleton-account-discount-order-h5'}`}
          />
          <Skeleton loading={showLoading} title row={1} type='column'
            className={`my-skeleton-account-discount-order ${TARO_ENV + 'my-skeleton-account-discount-order-h5'}`}
          />
          <Skeleton loading={showLoading} title row={1} type='column'
            className={`my-skeleton-account-discount-order ${TARO_ENV + 'my-skeleton-account-discount-order-h5'}`}
          />
          <Skeleton loading={showLoading} title row={1} type='column'
            className={`my-skeleton-account-discount-order ${TARO_ENV + 'my-skeleton-account-discount-order-h5'}`}
          />
        </View>}
        <Skeleton animate={false} loading={showLoading} title className='my-skeleton-share-seller' />
        {showLoading && <View className='order-top-header'>
          <Skeleton loading={showLoading} title className='my-skeleton-account-discount-order-top-left' />
        </View>}
        {showLoading && <View className='my-skeleton-account-discount-order-header'>
          <Skeleton loading={showLoading} title row={1} type='column'
            className={`my-skeleton-account-discount-order ${TARO_ENV + 'my-skeleton-account-discount-order-h5'}`}
          />
          <Skeleton loading={showLoading} title row={1} type='column'
            className={`my-skeleton-account-discount-order ${TARO_ENV + 'my-skeleton-account-discount-order-h5'}`}
          />
          <Skeleton loading={showLoading} title row={1} type='column'
            className={`my-skeleton-account-discount-order ${TARO_ENV + 'my-skeleton-account-discount-order-h5'}`}
          />
          <Skeleton loading={showLoading} title row={1} type='column'
            className={`my-skeleton-account-discount-order ${TARO_ENV + 'my-skeleton-account-discount-order-h5'}`}
          />
        </View>}
        {showLoading && <View style='height: 80Px' />}
        {!showLoading && <View className={`service-box ${TARO_ENV + 'service-box'}`}>
          <View className='card'>
            <View className='card-head'>
              <View className='title'>我的福利</View>
            </View>
            <View className='card-content'>
              {process.env.IS_SHOW_RED_BAG && <View onClick={this.gotoPage.bind(this, '/main/my/redbag/list')} className='grid-item'>
                <AtIcon prefixClass='car' value='iconhongbao2' color='#000' />
                <View className='btn-text'>我的红包</View>
              </View>}
              {process.env.IS_SHOW_INTEGRAL && platformSet.isJumpIntegral &&
              <View onClick={this.gotoPage.bind(this, '/main/my/integral/integral')} className='grid-item'>
                <AtIcon prefixClass='car' value='iconhuiyuan' color='#000' />
                <View className='btn-text'>我的{getGlobalData()}</View>
              </View>}
              {TARO_ENV !== 'tt' && <View onClick={this.gotoPage.bind(this, '/other/appointment/list')} className='grid-item'>
                <AtIcon prefixClass='car' value='iconyuyue1' color='#000' />
                <View className='btn-text'>我的预约</View>
              </View>}
              <View className='grid-item' onClick={this.contactSite.bind(this)}>
                <AtIcon prefixClass='car' value='iconlianxi' color='#000' />
                <View className='btn-text'>联系平台</View>
              </View>
              {process.env.P_ENV !== 'kd' &&
              <View className='grid-item' onClick={this.gotoPage.bind(this, '/distributor/meals/list')}>
                <AtIcon prefixClass='car' value='icontaocan' color='#000' />
                <View className='btn-text'>我的套餐</View>
              </View>}
              {process.env.IS_SHOW_COUPON && <View onClick={this.gotoPage.bind(this, '/main/coupon/index')} className='grid-item'>
                <AtIcon prefixClass='car' value='iconpiaowu' color='#000' />
                <View className='btn-text'>我的优惠券</View>
              </View>}
              {TARO_ENV !== 'tt' && !!platformSet.application_open_rookie_guide &&
              <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/my/guidePage/anovice')}>
                <AtIcon value='icon icon-weibiaoti-3' className={`${TARO_ENV + 'icon'}`} color='#000' />
                <View className='btn-text'>新手引导</View>
              </View>}
              {process.env.P_ENV === 'kontai' &&
              <View onClick={this.gotoPage.bind(this, '/main/tyy/reclaimer')} className='grid-item'>
                <AtIcon size='40px' prefixClass='car' value='iconmaidan1' color='#000' />
                <View className='btn-text'>获取{getGlobalData()}</View>
              </View>}
              {process.env.P_ENV === 'kontai' &&
              <View onClick={this.gotoPage.bind(this, '/other/integral/recording')} className='grid-item'>
                <AtIcon prefixClass='car' value='iconhuqujilu' color='#000' />
                <View className='btn-text'>获取记录</View>
              </View>}
              {(process.env.P_ENV === 'vc' || process.env.P_ENV === 'kunxin') &&
              <View onClick={this.gotoPage.bind(this, '/other/collection/list')} className='grid-item'>
                <AtIcon prefixClass='tabpole' value='icona-tubiaozhizuomoban1' color='#000' />
                <View
                  className='btn-text'
                >我的收藏</View>
              </View>}
              {process.env.TARO_ENV !== 'tt' && (process.env.P_ENV === 'vc' || process.env.P_ENV === 'kunxin') &&
              <View onClick={this.gotoPage.bind(this, '/other/evaluation/index')} className='grid-item'>
                <AtIcon prefixClass='tabpole' value='iconkz' color='#000' />
                <View
                  className='btn-text'
                >我的评价</View>
              </View>}
              {/*TARO_ENV === 'weapp' && http.getSiteHash() === 'ffd23ded-dc2a-40d0-80a3-7f479313b501' && <View onClick={this.gotoPage.bind(this, '/other/my/accountConsolidation')} className='grid-item'>
                <AtIcon value='user' color='#000' />
                <View
                  className='btn-text'
                >账号合并</View>
              </View>*/}
            </View>
          </View>
        </View>}
        {!showLoading && process.env.TARO_ENV === 'tt' && <View className={`service-box ${TARO_ENV + 'service-box'}`}>
          <View className='card'>
            <View className='card-head' onLongPress={()=> {
              console.log(1)
              Taro.clearStorageSync()
            }}
            >
              <View className='title'>更多服务</View>
            </View>
            <View className='card-content'>
              <Button open-type='contact' className='grid-item tt-button'>
                <AtIcon value='icon icon-kefu-01' color='#000' />
                <View className='btn-text'>联系客服</View>
              </Button>
              {certificationUrl && certificationUrl.length > 0 && <View onClick={()=>{Taro.previewImage({ urls: certificationUrl, current: certificationUrl[0] })}} className='grid-item'>
                <AtIcon prefixClass='tabpole' value='icondailizizhizizhiqiyezizhi' color='#000' />
                <View
                  className='btn-text'
                >服务资质</View>
              </View>}
            </View>
          </View>
        </View>}
        {
          (process.env.P_ENV !== 'lx' || NOT_LX_H5) && process.env.DISTINGUISH_IDENTITY &&
          userIdentity && !userIdentity.isSeller && userIdentity.showModule.isShow && !showLoading &&
          <Image className='shareImg' onClick={this.witchGoto.bind(this, userIdentity.showModule.url)}
            src={userIdentity.showModule.image} mode='aspectFill'
          />
        }
        {!showLoading && <Block>
          {TARO_ENV !== 'h5' && openMp && <Subscription data={openMp} />}
          {TARO_ENV === 'h5' && platform.subscription && platform.subscription.show_place !== '' && platform.subscription.show_place !== undefined && platform.subscription.show_place.indexOf("1") > -1 &&
          <Subscription data={platform.subscription} />}
          {TARO_ENV !== 'tt' && userIdentity && userIdentity.isSeller && <View className={`seller-box ${TARO_ENV + 'seller-box'}`}>
            <View className='card'>
              <View className='card-head'>
                <View className='title'>我的生意经</View>
              </View>
              <View className='card-content'>
                {!!platformSet.application_open_daren_classroom &&
                <View className='grid-item'
                  onClick={this.gotoPage.bind(this, `/main/lectureRoom/index`)}
                >
                  <AtIcon value='icon icon-daren' color='#000' />
                  <View className='btn-text'>{process.env.fxName}讲堂</View>
                </View>
                }
                {
                  (process.env.P_ENV !== 'lx' || NOT_LX_H5) &&
                  (userIdentity.platformSellerType === 1 || (userIdentity.platformSellerType === 0 && userIdentity.sellerType === 2)) && userIdentity.isCanHaveSon &&
                  <View className='grid-item'
                    onClick={this.gotoPage.bind(this, `/main/my/distributor/index`)}
                  >
                    <AtIcon prefixClass='car' value='iconfazhanfen' color='#000' />
                    <View className='btn-text'>发展{process.env.fxName}</View>
                  </View>
                }
                {!(userIdentity.platformSellerType === 0 && userIdentity.sellerType === 1) && userIdentity.isCanHaveSon &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/distributor/list/list2?all=0')}>
                  <AtIcon prefixClass='car' value='iconwodetuandui' color='#000' />
                  <View className='btn-text'>我的{process.env.fxName}</View>
                </View>}
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/order/promotionOrder')}>
                  <AtIcon prefixClass='car' value='icondingdan' color='#000' />
                  <View className='btn-text'>我的{process.env.fxName}单</View>
                </View>
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/distributor/profile/profile')}>
                  <AtIcon prefixClass='car' value='iconxinshougonglve' color='#000' />
                  <View className='btn-text'>资料修改</View>
                </View>
                <View className='grid-item' onClick={this.getPoster.bind(this)}>
                  <AtIcon prefixClass='car' value='iconhuiyuan2' color='#000' />
                  <View className='btn-text'>发展用户</View>
                </View>
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/other/my/customer')}>
                  <AtIcon prefixClass='car' value='iconwodehuiyuan1' color='#000' />
                  <View className='btn-text'>我的用户</View>
                </View>
                {!!platform.info.is_show_rank &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/distributor/ranking/ranking')}>
                  <AtIcon prefixClass='car' value='iconpaihangbang' color='#000' />
                  <View className='btn-text'>{process.env.fxName}排榜</View>
                </View>}
                {newsNum && !!newsNum.isNewcomerNews && <Navigator hoverClass='none' className='grid-item'
                  url={"/common/news/list?typeId=" + (newsNum.newcomerTypeId || '')}
                >
                  <AtIcon prefixClass='car' value='iconhuiyuanzhongxin6' color='#000' />
                  <View className='btn-text'>新手攻略</View>
                </Navigator>}
                {newsNum && newsNum.isSellerNews === 1 && <Navigator hoverClass='none' className='grid-item'
                  url={"/common/news/list?typeId=" + (newsNum.newsTypeId || '')}
                >
                  <AtIcon prefixClass='car' value='iconxiaoxi' color='#000' />
                  <View className='btn-text'>公告通知</View>
                  {newsNum.sellerNewsNoReadNum > 0 && <View className='red-dot'>{newsNum.sellerNewsNoReadNum}</View>}
                </Navigator>}
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/page/my/teamappoint/supplier/list')}>
                  <AtIcon value='icon icon-hexiaoyuanguanli-011' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>团队预约单</View>
                </View>
                {!!platformSet.application_open_rookie_task &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/my/newbieTask/index')}>
                  <AtIcon value='icon icon-xinshou' color='#000' />
                  <View className='btn-text'>新手任务</View>
                </View>}
              </View>
            </View>
          </View>}
          {TARO_ENV !== 'tt' && userIdentity && userIdentity.isSupplier && <View className={`supplier-box ${TARO_ENV + 'supplier-box'}`}>
            <View className='card'>
              <View className='card-head'>
                <View className='title'>供应商平台</View>
              </View>
              <View className='card-content'>
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/supplier/check-ticket')}>
                  <AtIcon prefixClass='car' value='iconhexiao2' color='#000' />
                  <View className='btn-text'>核销</View>
                </View>
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/supplier/ticket-record')}>
                  <AtIcon prefixClass='car' value='iconhexiaojilu' color='#000' />
                  <View className='btn-text'>核销记录</View>
                </View>
                {hasSupplier && isMd &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/other/buy-order/money')}>
                  <AtIcon prefixClass='car' value='iconshoukuanma1' color='#000' />
                  <View className='btn-text'>买单</View>
                </View>}
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/supplier/ticket-summary')}>
                  <AtIcon prefixClass='car' value='iconchulidingdan2' color='#000' />
                  <View className='btn-text'>核销汇总</View>
                </View>
                {userIdentity.isSupplierAuditor && <View className='grid-item'
                  onClick={this.gotoPage.bind(this, '/main/supplier/manage-appointment?id=104')}
                >
                  <AtIcon prefixClass='car' value='iconrili' color='#000' />
                  <View className='btn-text'>预约管理</View>
                </View>}
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/page/my/teamappoint/splist')}>
                  <AtIcon value='icon icon-hexiaoyuanguanli-011' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>团队预约单</View>
                </View>
                {userIdentity.isSuperChecker &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/distributor/wallet/supplier')}>
                  <AtIcon value='icon icon-tixian' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>提现</View>
                </View>}
                {userIdentity.isSuperChecker && <View className='grid-item'
                  onClick={this.gotoPage.bind(this, '/main/my/cancelAfterVerification/index?supplierId=4566')}
                >
                  <AtIcon value='icon icon-tongji' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>核销统计</View>
                </View>}
                {userIdentity.isSuperChecker &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/my/cancelAfterManagement/index')}>
                  <AtIcon value='icon icon-hexiaoyuan' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>核销员管理</View>
                </View>}
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/my/requestInvoice/list')}>
                  <AtIcon value='icon icon-a-2tubiaozhizuomoban' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>申请发票</View>
                </View>
                {
                  TARO_ENV === "weapp" && wifiVisible &&
                  <View className='grid-item' onClick={this.gotoPage.bind(this, '/other/wifi/index')}>
                    <Image mode='aspectFill'
                      src='https://resource.ivcheng.com/upload/images/20220901/1662015279433_286.png'
                      style={{width: "25px", height: "22px"}}
                    />
                    <View className='btn-text'>WiFi</View>
                  </View>
                }
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/other/aliLocalLife/supplier/list')}>
                  <AtIcon value='shopping-bag' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>商品信息</View>
                </View>
              </View>
            </View>
          </View>}
          {TARO_ENV !== 'tt' && userIdentity && userIdentity.isSite && <View className={`admin-box ${TARO_ENV + 'admin-box'}`}>
            <View className='card'>
              <View className='card-head'>
                <View className='title'>商家平台</View>
              </View>
              <View className='card-content'>
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/other/site/order')}>
                  <AtIcon prefixClass='car' value='iconchulidingdan2' color='#000' />
                  <View className='btn-text'>订单处理</View>
                </View>
                <View className='grid-item'
                  onClick={this.gotoPage.bind(this, `/main/my/distributor/index?isFirst=site`)}
                >
                  <AtIcon prefixClass='car' value='iconfazhanyijifenxiao' color='#000' />
                  <View
                    className='btn-text'
                  >{userIdentity.platformSellerType === 0 ? '发展一级' + process.env.fxName : '发展' + process.env.fxName}</View>
                </View>
                {!(userIdentity.platformSellerType === 0 && userIdentity.sellerType === 1) &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/distributor/list/list?all=1')}>
                  <AtIcon prefixClass='car' value='iconwodetuandui' color='#000' />
                  <View className='btn-text'>我的团队</View>
                </View>}
                <View className='grid-item'
                  onClick={this.gotoPage.bind(this, '/page/my/teamappoint/site/list?page=sitemini')}
                >
                  <AtIcon value='icon icon-hexiaoyuanguanli-011' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>团队预约单</View>
                </View>
                {process.env.P_ENV === 'kd' &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/my/marketPerformance/index')}>
                  <AtIcon value='icon icon-yewu' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>市场业绩</View>
                </View>}
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/my/businessPerformance/index')}>
                  <AtIcon value='icon icon-yewu' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>商家业绩</View>
                </View>
                {(userIdentity.is_bd == 1 || userIdentity.is_bdm == 1) &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/businessList/index')}>
                  <AtIcon value='icon icon-shangjia' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>商家信息</View>
                </View>}
                {(userIdentity.is_bd == 1 || userIdentity.is_bdm == 1) &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/main/productList/index')}>
                  <AtIcon value='icon icon-chanpin' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>产品信息</View>
                </View>}
                {!!platformSet.is_open_tiktok_life &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/other/aliLocalLife/businessList')}>
                  <AtIcon value='icon icon-shangjia' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>抖音商家</View>
                </View>}
                {!!platformSet.is_open_tiktok_life &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/other/aliLocalLife/productList')}>
                  <AtIcon value='icon icon-chanpin' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>抖音产品</View>
                </View>}
                {Number(userIdentity.is_bdm) === 1 &&
                <View className='grid-item' onClick={this.gotoPage.bind(this, '/other/site/writeOffStatistics')}>
                  <AtIcon value='iconchulidingdan2' prefixClass='car' color='#000' className={`${TARO_ENV + 'icon'}`} />
                  <View className='btn-text'>核销统计</View>
                </View>}
              </View>
            </View>
          </View>}
          {(userIdentity.aboutUUID || userIdentity.joinId) && <View className='support-wrap support-wrap-my'>
            <View className='support-box'>
              {(userIdentity.aboutUUID) &&
              <Navigator className='support-item'
                url={`/common/news/detail?uuid=${userIdentity.aboutUUID}`}
              >
                <View className='info-box'>
                  <View className='icon icon-style' style='height: initial;'>
                    <AtIcon className='icon-style' prefixClass='car' value='iconguanyuwomen2' color='#000' />
                  </View>
                  <View>关于我们</View>
                </View>
                <View><AtIcon value='chevron-right' size='20' color='#C8C8CD' /></View>
              </Navigator>
              }
              {(userIdentity.joinId) &&
              <View className='support-item'
                onClick={this.businessCooperation.bind(this)}
              >
                <View className='info-box'>
                  <View className='icon icon-style' style='height: initial;'><AtIcon prefixClass='xxhz'
                    value='shangjiahezuo'
                    color='#000'
                  /></View>
                  <View>商家合作</View>
                </View>
                <View><AtIcon value='chevron-right' size='20' color='#C8C8CD' /></View>
              </View>}
            </View>
          </View>}
          <View className='hot-block'>
            <View className='hot-block-title'>
              <Image className='hot-block-img' mode='aspectFill'
                src='https://resource.ivcheng.com/upload/file/c0b3a36a1c754f5bad1425e730e86003.png'
              />
              <View>热门推荐</View>
            </View>
            <SmallGoodsBox data={goodsList} />
          </View>
          <SupportBar />
        </Block>}
        <LiveCode subTitle='添加您的专属顾问微信，' secondSubTitle='有任何问题将在第一时间回复' qrImg={qrImg} modalShow={modalShow}
          contactPhone={contactPhone} onClose={() => {
          this.setState({modalShow: false})
        }} title={qrImgDescribe}
        />
        <LiveCode subTitle='请添加您的专属顾问微信，' secondSubTitle='有任何问题将在第一时间回复' qrImg={businessCooperationImg}
          modalShow={modalShowBusiness} onClose={() => {
          this.setState({modalShowBusiness: false})
        }} title={businessCooperationImgDescribe}
        />
      </View>
    );
  }
}

export default Index as ComponentClass<PageOwnProps, PageState>
